package NsingCHM.Controls;

/** 
 DropDownList ��ժҪ˵����
*/
public class DropDownList
{
	public DropDownList()
	{

	}

	/** 
	 ��ĳ�굽��ǰ��1�� �󶨵�DropDownList
	 
	 @param DDL
	*/
	public static void SetYearAndMonth(System.Web.UI.WebControls.DropDownList DDL, int Year)
	{
		int nowYear = java.time.LocalDateTime.now().getYear();
		int nowMonth = java.time.LocalDateTime.now().getMonthValue();
		for (int i = Year; i <= nowYear; i++)
		{

			for (int y = 1; y <= 12; y++)
			{
				if (i == nowYear && y > nowMonth)
				{
					return;
				}
				String ys = String.valueOf(y).length() == 1 ? "0" + String.valueOf(y): String.valueOf(y);
				DDL.Items.Add(String.valueOf(i) + "��" + ys + "��");
			}
		}
	}

	public static void GetYearAndMonty(System.Web.UI.WebControls.DropDownList DDL, tangible.RefObject<Integer> Year, tangible.RefObject<Integer> Month)
	{
		Year.argValue = Integer.parseInt(DDL.SelectedItem.Text.substring(0,4));
		Month.argValue = Integer.parseInt(DDL.SelectedItem.Text.substring(5, 7));
	}

}